Skip to content

#10: ADL — conditional effects, quantifiers, full precondition trees#115

Merged
hfoffani merged 2 commits into
mainfrom
adl-10
Jul 13, 2026
Merged

#10: ADL — conditional effects, quantifiers, full precondition trees#115
hfoffani merged 2 commits into
mainfrom
adl-10

Conversation

@hfoffani

Copy link
Copy Markdown
Owner

Closes #10.

What

Brings the library from STRIPS+typing+negative-preconditions to ADL level, evaluated end-to-end: parse → ground → State.applicable/apply → solved by the reference planners.

Design (implemented by a background agent, reviewed and finished in-session)

  • Condition tree on Operator (Lit/Not/And/Or/Equality/NumericCond/Exists/Forall): lifted precondition_tree, grounded precondition; holds(atoms, fluents) evaluates the full boolean structure — or, imply, =, quantifiers are evaluated, no longer just preserved (precondition formula using OR #13's connective becomes a special case).
  • Effect tree (AddDel/NumEff/EffAnd/When/Universal): grounding compiles it into the flat unconditional effects plus CondEffect guards that State.apply fires only when their condition holds in the pre-state.
  • Quantifier grounding by expansion over typed world objects: forallAnd (vacuously true when no objects), existsOr (vacuously false).
  • Fast path preserved: a simple_conjunction flag keeps plain STRIPS on the static-pruned binder; richer preconditions fall back to the cartesian product so no applicable binding is dropped.
  • Capability negotiation: planners accept :adl, :equality, :disjunctive-preconditions, :quantified/:universal/:existential-preconditions, :conditional-effects; :adl is the umbrella.
  • pddlpy validate's atom walker handles the new trees.

Documented remaining gaps (in docs/object-model.md)

  • ADL structure on the goal side (or/forall/exists in (:goal …)) is still flattened to a conjunction — listed under Future development.
  • (either …) union types (pre-existing).

Tests

Corpus: briefcase (the classic conditional-effects domain) and rooms (quantifiers), solved by the planners. Suite 221 passing (+30), 100% coverage, ruff/mypy clean, full make green.

Conflicts note

Parallel to #114 (temporal, #84): both touch pddlpy/planning/state.py, docs, and README's Future-development list. Merge either first; I'll rebase the other.

🤖 Generated with Claude Code

hfoffani and others added 2 commits July 13, 2026 10:22
Operators now carry structured trees next to the flat STRIPS fields:
a Condition tree (Lit/Not/And/Or/Equality/NumericCond/Exists/Forall)
evaluated by condition.holds(), and an Effect tree (AddDel/NumEff/
EffAnd/When/Universal) that grounding compiles into the unconditional
effects plus CondEffect guards fired by State.apply against the
pre-state. Quantifiers ground by expansion over typed world objects
(forall vacuously true, exists vacuously false). A simple_conjunction
flag keeps plain-STRIPS grounding on the static-pruned fast path;
richer preconditions fall back to the cartesian product so no
applicable binding is dropped.

Reference planners now accept and evaluate :adl, :equality,
:disjunctive-preconditions, :quantified/:universal/:existential-
preconditions and :conditional-effects via capability negotiation.
diagnostics._condition_atoms walks the new trees. Corpus: briefcase
(conditional effects) and rooms (quantifiers). Known gaps documented:
ADL inside (:goal ...) is still flattened; (either ...) unhandled.

Suite 221 passing (+30), 100% coverage, ruff/mypy clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Conflict in docs/object-model.md Known limitations: kept the ADL entry
(goal-side gap) and main's temporal entry; the stale 'or preserved but
not evaluated' bullet is superseded by both sides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hfoffani hfoffani self-assigned this Jul 13, 2026
@hfoffani
hfoffani merged commit 164e16a into main Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend the implementation to ADL

1 participant